Skip to content

Conversation

@Moustachauve
Copy link
Contributor

This is a second try for #251.

This is not changing the isfile, so the issue with No such file or directory: 'hilo_state.yaml' should not happen again.

I also found an issue when doing from __future__ import annotations that would break the dict detection in _get_defaults. I left a bunch of comments explaining what the code is doing, since it's a bit obscure.

D100 Missing docstring in public module
UP035 typing.Type is deprecated, use type instead
D101 Missing docstring in public class
FA100 Add from __future__ import annotations to simplify typing.Optional
N807 Function name should not start and end with __
UP006 Use type instead of Type for type annotation
D400 First line should end with a period
D401 First line of docstring should be in imperative mood: "Generates a default dict based on typed dict"
D415 First line should end with a period, question mark, or exclamation point
PGH003 Use specific rule codes when ignoring type issues
D205 1 blank line required between summary line and description
FA100 Add from __future__ import annotations to simplify typing.Union

Not done in this PR:
PTH113 os.path.isfile() should be replaced by Path.is_file()

This is not really needed, I feel it would make the code harder to read and it would make performance a tiny fraction worse too, so let's not do that since we don't need anything else from the Path object.

@ic-dev21 ic-dev21 merged commit ff21297 into dvd-dev:main Apr 7, 2025
1 check failed
@Moustachauve Moustachauve deleted the refactor-state branch April 7, 2025 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants